<?php

	function getAdminNameByID($adminID)
	{
		if(!isset($adminID) || $adminID < 1):
			return "";
		endif;
		require("private\mysqli_connect.php");
		$result = $db->query("select username from administrators where administrators.admin_id = $adminID");
		if($result->num_rows):
			$row = $result->fetch_array();
			return $row['username'];
		else:
			return "";
		endif;
	}	
	
	function getTicketInfo($ticketNumber)
	{
		require('\private\mysqli_connect.php');		
		$query = 	'select * from tickets left join administrators 
					on tickets.administrator_id = administrators.admin_id
					where tickets.ticket_id = ' . $ticketNumber . '' ;
		// echo "<br/>";
		// var_dump($query);
		$result = $db->query($query);
		if(!$result):
			echo "Unable to display ticket.</br>";
			return null;
		else:
			return $result->fetch_array();
		endif;
	}
?>